#pragma once
#include "CImage.h"
#include "CellID.h"
namespace DarkStorm2D
{
	class CTemplateSet
	{
	protected:
		GraphicsCore::ImagePtr m_Image;
		uint m_CellWidth;
		uint m_CellHeight;
	public:
		CTemplateSet()
		{
			m_Image = NULL;
			m_CellWidth = 0;
			m_CellHeight = 0;
		}
		~CTemplateSet()
		{
			m_Image = NULL;
			m_CellWidth = 0;
			m_CellHeight = 0;
		}

		void Create(GraphicsCore::ImagePtr& Image, uint CellWidth, uint CellHeight)
		{
			m_Image = Image;
			m_CellWidth = CellWidth;
			m_CellHeight = CellHeight;
		}
		void GetRect(CellID Cell, CRect* Rect)
		{
			Rect->m_Top = Cell.Y* m_CellHeight;
			Rect->m_Left = Cell.X* m_CellWidth;

			Rect->m_Right = Cell.X* m_CellWidth + m_CellWidth;
			Rect->m_Bottom = Cell.Y* m_CellHeight + m_CellHeight;
		}
		uint GetCellWidth() {return m_CellWidth;}
		uint GetCellHeight() {return m_CellHeight;}
		GraphicsCore::ImagePtr& GetImage() {return m_Image;}
	};
};